import Vue from 'vue'
import Router from 'vue-router'
import index from '@/components/index'
import header from '@/components/public/navi'
import Team from '@/components/team/TeamList'
import leagues from '@/components/team/leagues'
import scrolls from '@/components/public/scrolls'
import addCommodity from '@/components/back/team/AddCommodity'
import addTeam from '@/components/back/team/addTeam'
import addUser from '@/components/front/user/addUser'
import testAddUser from '@/components/front/user/testAddUser'
import backIndex from '@/components/back/index'
import restaurant from '@/components/front/restaurant'
import supplier from '@/components/back/supplier'
import frontsupplier from '@/components/front/supplier'
import orderForm from '@/components/back/orderForm'
import supplierOrder from '@/components/back/supplierOrder'
import praiseRes from '@/components/back/praiseRes'
import schedule from '@/components/front/chef/schedule'
import chef from '@/components/front/chef'
import frontuser from '@/components/front/user'
import ranklist from '@/components/public/ranklist'
import user from '@/components/front/user'
import backActive from '@/components/back/active'
import frontActive from '@/components/front/active'
import frontadmin from '@/components/front/admin'
import login from '@/components/login.vue'
import footer from '@/components/public/footer.vue'
import userindex from '@/components/userPersonal/user'
import chefindex from '@/components/userPersonal/chef'
import supplierindex from '@/components/userPersonal/supplier'
import restaurantindex from '@/components/userPersonal/restaurant'




Vue.use(Router)

export default new Router({
  mode:'history',

  routes: [
    {
      path: '/restaurantindex',
      name: 'restaurantindex',
      component: restaurantindex
    },
    {
      path: '/supplierindex',
      name: 'supplierindex',
      component: supplierindex
    },
    {
      path: '/chefindex',
      name: 'chefindex',
      component: chefindex
    },
    {
      path: '/userindex',
      name: 'userindex',
      component: userindex
    },
    {
      path: '/frontuser',
      name: 'frontuser',
      component: frontuser
    },
    {
      path: '/frontsupplier',
      name: 'frontsupplier',
      component: frontsupplier
    },
    {
      path: '/back/active',
      name: 'backActive',
      component: backActive
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },

    {
      path: '/front/active',
      name: 'frontActive',
      component: frontActive
    },
    {
      path: '/front/chef',
      name: 'chef',
      component: chef
    },
    {
      path: '/ranklist',
      name: 'ranklist',
      component: ranklist
    },{
      path: '/front/user',
      name: 'user',
      component: user
    },
    {
      path: '/',
      name: 'index',
      component: index
    },
    {
      path: '/Team',
      name: 'Team',
      component: Team
    },
    {
      path: '/leagues',
      name: 'leagues',
      component: leagues
    },
    {
      path: '/scrolls',
      name: 'scrolls',
      component: scrolls
    },
    {
      path: '/addCommodity',
      name: 'addCommodity',
      component: addCommodity
    },
    {
      path: '/addTeam',
      name: 'addTeam',
      component: addTeam
    },
    {
      path: '/addUser',
      name: 'addUser',
      component: addUser
    },
    {
      path: '/testAddUser',
      name: 'testAddUser',
      component: testAddUser
    },
    {
      path: '/header',
      name: 'header',
      component: header
    },
    {
      path: '/front/restaurant',
      name: 'restaurant',
      component: restaurant
    },
    {
      path: '/supplier',
      name: 'supplier',
      component: supplier
    },
    {
      path: '/orderForm',
      name: 'orderForm',
      component: orderForm
    },
    {
      path: '/praiseRes',
      name: 'praiseRes',
      component: praiseRes
    },
    {
      path: '/supplierOrder',
      name: 'supplierOrder',
      component: supplierOrder
    },
    {
      path: '/back',
      name: 'backIndex',
      component: backIndex,
      children: [
        {
          path: '/back/team',
          component: resolve => require(['@/components/back/team/'], resolve),
          meta: {title: '球队管理'}
        },
        {
          path: '/back/activitytype',
          component: resolve => require(['@/components/back/activitytype/'], resolve),
          meta: {title: '活动类型管理管理'}
        },
        {
          path: '/back/chef',
          component: resolve => require(['@/components/back/chef'], resolve),
          meta: {title: '厨师管理'}
        },
        {
          path: '/back/restaurant',
          component: resolve => require(['@/components/back/restaurant'], resolve),
          meta: {title: '饭店管理'}
        },
        {
          path: '/back/supplier',
          component: resolve => require(['@/components/back/supplier'], resolve),
          meta: {title: '供应商管理'}
        },
        {
          path: '/back/orderForm',
          component: resolve => require(['@/components/back/orderForm'], resolve),
          meta: {title: '饭店订单管理'}
        },
        {
          path: '/back/praiseRes',
          component: resolve => require(['@/components/back/praiseRes'], resolve),
          meta: {title: '饭店点赞详情'}
        },
        {
          path: '/back/supplierOrder',
          component: resolve => require(['@/components/back/supplierOrder'], resolve),
          meta: {title: '蔬菜供应商订单详情'}
        },

        {
          path: '/back/admin',
          component: resolve => require(['@/components/back/admin'], resolve),
          meta: {title: '管理员管理'}
        },
        {
          path: '/back/news',
          component: resolve => require(['@/components/back/news'], resolve),
          meta: {title: '新闻管理'}
        },
        {
          path: '/back/newsrecord',
          component: resolve => require(['@/components/back/newsrecord'], resolve),
          meta: {title: '新闻审核记录管理'}
        },
        {
          path: '/back/adminchef',
          component: resolve => require(['@/components/back/adminchef'], resolve),
          meta: {title: '厨师审核管理'}
        },
        {
          path: '/back/adminrno',
          component: resolve => require(['@/components/back/adminrno'], resolve),
          meta: {title: '饭店审核管理'}
        },
        {
          path: '/back/activetyrecord',
          component: resolve => require(['@/components/back/activetyrecord'], resolve),
          meta: {title: '活动记录管理'}
        },
        {
          path: '/back/others',
          component: resolve => require(['@/components/back/others'], resolve),
          meta: {title: '第三方管理'}
        },
        {
          path: '/back/festival',
          component: resolve => require(['@/components/back/festival'], resolve),
          meta: {title: '节日管理'}
        },
        {
          path: '/back/costtype',
          component: resolve => require(['@/components/back/costtype'], resolve),
          meta: {title: '消费卷管理'}
        },
        {
          path: '/back/actcosttyperecord',
          component: resolve => require(['@/components/back/actcosttyperecord'], resolve),
          meta: {title: '活动消费卷消费管理'}
        },

        {
          path: '/back/user',
          component: resolve => require(['@/components/back/user'], resolve),
          meta: {title: '用户管理'}
        },
        {
          path: '/back/ticketrecord',
          component: resolve => require(['@/components/back/ticketrecord'], resolve),
          meta: {title: '消费券记录管理'}
        },
        {
          path: '/back/cheforder',
          component: resolve => require(['@/components/back/cheforder'], resolve),
          meta: {title: '厨师订单记录管理'}
        },
        {
          path: '/back/praisechef',
          component: resolve => require(['@/components/back/praisechef'], resolve),
          meta: {title: '厨师点赞记录管理'}
        }
      ]
    },
    {
      path: '/front/chef/schedule',
      name: 'schedule',
      component: schedule
    },
  ]
})
